Skip to content

🌱 Bump github.com/sergi/go-diff from 1.4.0 to 1.4.5 - #579

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/sergi/go-diff-1.4.5
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/sergi/go-diff-1.4.5

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Bumps github.com/sergi/go-diff from 1.4.0 to 1.4.5.

Release notes

Sourced from github.com/sergi/go-diff's releases.

v1.4.5

Bug fixes:

  • PatchApply, PatchSplitMax and PatchAddContext now slice text on UTF-8 rune boundaries. Patches built from or applied to text with multi-byte characters no longer panic with "slice bounds out of range" and always produce valid UTF-8 (#132, #155).
  • Applying a patch to a text that has changed no longer panics when earlier edits leave the text shorter than the later insert and delete positions expect; positions are clamped to the text, as substring does in the reference implementation. This could panic on plain ASCII text.
  • A patch whose context ends inside a multi-byte rune no longer places an insertion one rune early while still reporting success.

Behavior:

  • PatchMake → PatchApply round trips are unchanged, including for multi-byte text. Applying a patch to a changed multi-byte text differs in ambiguous fuzzy-match cases, where previous releases produced invalid UTF-8 or panicked. Verified with a randomized differential comparison of half a million patch applications against v1.4.4: no panics, no invalid UTF-8, and identical round-trip and ASCII results.

v1.4.4

Performance:

  • PatchSplitMax is up to 50x faster on large patches: it now reads only the few bytes of trailing context it needs instead of rebuilding the remaining patch text for every piece.
  • MatchBitap, and so fuzzy matching in MatchMain and PatchApply, is about 2x faster thanks to an array lookup in its inner loop.
  • PatchFromText is about 20% faster: the header regex is compiled once and each header is matched once.
  • Line-mode diffs of large texts allocate about half as much memory and run up to 39% faster, because the line tables are sized up front.

No API or behavior changes. New benchmarks cover MatchBitap, PatchFromText, PatchApply and PatchSplitMax.

v1.4.3

Hardening:

  • PatchFromText rejects patch headers with out-of-range coordinates instead of silently clamping them; clamped coordinates could apply a patch at a wrong location and report success.

Documentation:

  • Runnable examples for diffing, plain text output, line diffing, the full patch cycle, fuzzy matching and semantic cleanup.
  • Documented the checklines flag, the diff operations, and the unique-line limit of DiffLinesToChars and DiffLinesToRunes.
  • README: live CI badge, corrected install command and origins link, and a status statement.

Project:

  • CI runs on Linux (Go 1.13 and latest), macOS and Windows, plus govulncheck, on every push and pull request and weekly.
  • The Makefile lint and test targets work again; Travis and its dead config are gone.
  • Branch protection requires the test suite to pass before merging.
  • Fixed a timing-dependent DiffBisect test on coarse clocks, found by the new Windows CI.

v1.4.2

Bug fixes:

  • PatchMake no longer panics when the source text contains invalid UTF-8 (#157, #158).

v1.4.1

Bug fixes:

  • Semantic cleanup now detects blank lines at the start of the following text, matching upstream diff-match-patch.
  • Semantic lossless cleanup no longer miscounts multibyte characters when shifting edits.
  • PatchFromText returns an error on invalid %xx escapes instead of silently emptying the line.
  • Minor: DiffMainRunes no longer writes to the caller's rune slice; fixed DiffFromDelta and intToRune error messages.

Diff output from semantic cleanup may differ slightly for text with blank lines or non-ASCII characters.

Commits
  • 3069921 test: use utf8.ValidString in the rune-safety tests
  • 7f6d802 Merge pull request #155 from SnowWarri0r/pr1/fix-issue-132-rune-safe-slicing
  • ce0771e fix: round range ends outward and clamp indices in PatchApply
  • b2f00cc fix: rune-safe byte slicing in Patch{Apply,SplitMax,AddContext}
  • 22140c5 perf: remove avoidable allocations and repeated work in diff, match and patch
  • b559db2 ci: run govulncheck and a weekly build
  • 916526d docs: describe the diff operations and the checklines flag
  • f1e2884 docs: add runnable examples for the common tasks
  • e8a5652 docs: describe go-diff as finished and actively maintained
  • 375295f test: use an unambiguously expired deadline in the DiffBisect timeout case
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Summary by CodeRabbit

  • Chores
    • This update does not change the product’s visible features, interface, or behavior. No new capabilities or user-facing fixes are included. There are no changes to how the product is used, and no action is required.

Bumps [github.com/sergi/go-diff](https://github.com/sergi/go-diff) from 1.4.0 to 1.4.5.
- [Release notes](https://github.com/sergi/go-diff/releases)
- [Commits](sergi/go-diff@v1.4.0...v1.4.5)

---
updated-dependencies:
- dependency-name: github.com/sergi/go-diff
  dependency-version: 1.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The github.com/sergi/go-diff dependency requirement changed from v1.4.0 to v1.4.5.

Changes: Dependency update

Layer / File(s) Summary
Update go-diff version
go.mod
The required version of github.com/sergi/go-diff changed from v1.4.0 to v1.4.5.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested reviewers: everettraven

Merge Risk: Minimal · up to d02f9

This updates a diff library to a patch release that includes fixes for multibyte text handling and performance improvements. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: a Dependabot-style bump of github.com/sergi/go-diff from 1.4.0 to 1.4.5. The raw summary confirms that go.mod changed from v1.4.0 to v1.4.5, so the title matches the only c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: a Dependabot-style bump of github.com/sergi/go-diff from 1.4.0 to 1.4.5. The raw summary confirms that go.mod changed from v1.4.0 to v1.4.5, so the title matches the only change in the reviewed files. The ':seedling:' emoji is noise, but the title stays specific and accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

golangci-lint (2.15.0)

golangci-lint (2.15.0) skipped for .golangci.yml: configuration requires version: "2". Migrate older configurations using golangci-lint migrate and review the result; see https://golangci-lint.run/docs/product/migration-guide/.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 74ec03c9-ee2a-4f0b-ada1-8eebe36a6d62
Commits

Reviewing files that changed from the base of the PR and between 3722a95 and d02f9b0.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 1

  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/deps area/sdk dependencies Pull requests that update a dependency file go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants